/**
 * Title:		T08DragonCurve.java
 * Description: Test program for recursive function
 * 
 * @version		1.0 May 2009
 * @author		Hidemitsu Izawa (hi2136@columbia.edu)
 */
import kfrog.Frog;
import kfrog.Pond;

public class T08DragonCurve {
	
	public static void dragon(int n, int a, int h, Frog frog){
		if(n<1){
			frog.forward(h);
			return;
		}
		dragon (n-1,90,h, frog);
		frog.turnright(a);
		dragon (n-1,-90,h, frog);
	}
	
	public static void main(String args[]){
		/** pond */
		Pond pond = new Pond(400,400);
		pond.setPondColor("WHITE");
		
		/** frog1 */
		Frog frog1 = new Frog(pond,1);
		frog1.frogcolor("BLUE");
		frog1.speed(3);
		frog1.startdraw();
		dragon(9,90,7,frog1);
		Thread FROG1 = new Thread(frog1);
		FROG1.start();
	}
}
